<template>
  <a-card :bordered="false">

    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">

          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="推送类别">
              <j-dict-select-tag v-model="queryParam.remark1" placeholder="请选择"
                                 dictCode="tsrlb"/>
            </a-form-item>
          </a-col>

          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>

            </span>
          </a-col>

        </a-row>
      </a-form>
    </div>

    <!-- 操作按钮区域 -->
    <div class="table-operator">
      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
    </div>

    <!-- table区域-begin -->
    <div>


      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        class="j-table-force-nowrap"
        @change="handleTableChange">

        <span slot="action" slot-scope="text, record">
          <!--<a @click="handleEdit(record)">编辑</a>-->
          <a @click="handleDetail(record)">详情</a>
          <a-divider type="vertical" />
          <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
                  <a>删除</a>
                </a-popconfirm>
        </span>

      </a-table>
    </div>
    <!-- table区域-end -->

    <!-- 表单区域 -->
    <gMessage-modal ref="modalForm" @ok="modalFormOk"></gMessage-modal>
  </a-card>
</template>

<script>
  import '@/assets/less/TableExpand.less'
  import GMessageModal from './modules/GMessageModal'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'

  export default {
    name: "GMessageList",
    mixins:[JeecgListMixin],
    components: {
      GMessageModal
    },
    data () {
      return {
        description: '消息管理页面',
        // 表头
        columns: [
          {
            title: '序号',
            dataIndex: '',
            key:'rowIndex',
            width:60,
            align:"center",
            customRender:function (t,r,index) {
              return parseInt(index)+1;
            }
           },
          {
            title: '推送类别',
            align:"center",
            dataIndex: 'remark1_dictText'
          },
          /*{
            title: '消息类别',
            align:"center",
            dataIndex: 'remark3_dictText'
          },*/
		  /* {
            title: '接收人',
            align:"center",
            dataIndex: 'userId'
           },*/
		   {
            title: '消息标题',
            align:"center",
            dataIndex: 'title'
           },
		   {
            title: '消息内容',
            align:"center",
            dataIndex: 'content'
           },
          // {
          //   title: 'remark1',
          //   align:"center",
          //   dataIndex: 'remark1_dictText'
          // },
		   /*{
            title: '0:正常,1:删除',
            align:"center",
            dataIndex: 'delflag'
           },
		   {
            title: 'remark',
            align:"center",
            dataIndex: 'remark'
           },

		   {
            title: 'remark2',
            align:"center",
            dataIndex: 'remark2'
           },
		   {
            title: 'remark3',
            align:"center",
            dataIndex: 'remark3'
           },
		   {
            title: 'remark4',
            align:"center",
            dataIndex: 'remark4'
           },
		   {
            title: 'remark5',
            align:"center",
            dataIndex: 'remark5'
           },
		   {
            title: 'remark6',
            align:"center",
            dataIndex: 'remark6'
           },
		   {
            title: 'remark7',
            align:"center",
            dataIndex: 'remark7'
           },
		   {
            title: 'remark8',
            align:"center",
            dataIndex: 'remark8'
           },
		   {
            title: 'remark9',
            align:"center",
            dataIndex: 'remark9'
           },
		   {
            title: 'remark10',
            align:"center",
            dataIndex: 'remark10'
           },*/
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            scopedSlots: { customRender: 'action' },
          }
        ],
		url: {
          list: "/gmessage/gMessage/list",
          delete: "/gmessage/gMessage/delete",
          deleteBatch: "/gmessage/gMessage/deleteBatch",
          exportXlsUrl: "gmessage/gMessage/exportXls",
          importExcelUrl: "gmessage/gMessage/importExcel",
       },
    }
  },
  computed: {
    importExcelUrl: function(){
      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
    }
  },
    methods: {
     
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>